package cn.topkinson.lagou.s3m4.email.controller;

import cn.topkinson.base.api.email.EmailRemoteClient;
import cn.topkinson.lagou.s3m4.email.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author huangzihao
 * @Date 2020/9/9 15:39
 */
@RestController
@RequestMapping("/email")
public class EmailController implements EmailRemoteClient {

    @Autowired
    private EmailService emailService;

    /**
     * 发送验证码到邮箱，true成功，false失败
     * @param email
     * @return
     */
    @Override
    @GetMapping("/email/{email}/{code}")
    public Boolean email(@PathVariable String email,@PathVariable String code){
        return emailService.email(email,code);
    }
}
